/*
 * @Author: 清酒吖
 * @Date: 2022-01-19 10:59:55
 * @Email:  
 * @LastEditors:  
 * @LastEditTime: 2022-02-04 16:13:16
 * @Description: 
 * @version: x 1.0
 */
import request from '@/utils/request'

// @ 分页+条件查询商品品牌
export function findSpecOptions(data, pageNum, pageSize) {
    return request({
        url: `/spec/findSpecAndOptions?pageNum=${pageNum}&pageSize=${pageSize}`,
        method: 'post',
        data
    })

}

// @ 添加商品规格和规格选项
export function addSpecAndOptions(data) {
    return request({
        url: `/spec/addSpecAndOptions`,
        method: 'post',
        data
    })

}

// @ 修改商品规格和规格选项
export function updateOptions(data) {
    return request({
        url: `/spec/updateSpecOptions`,
        method: 'put',
        data
    })

}

// @ 删除商品规格和规格选项
export function removeSpecOption(data) {
    return request({
        url: `/spec/deleteSpecOptions`,
        method: 'delete',
        data
    })

}

// @ 查询所有商品规格
export function findSpec() {
    return request({
        url: `/spec/findAllSpec`,
        method: 'post',
    })

}

// @ 批量删除商品规格和规格选项
export function removeBrathSpecAndOptions(data) {
    return request({
        url: `/spec/delBathSpecAndOptions`,
        method: 'delete',
        data
    })

}

// @ 根据商品模板id获取商品规格信息
export function selectSpecAndOptions(templateId){
    return request({
        url: `/spec/findSpecAndOptions/${templateId}`,
        method: 'get',
    })
}